package demo8;

abstract class Shape{
    // 普通属性
    String name = "图形类";
    Shape(String name){
        this.name = name;
    }
    // 抽象方法
    abstract  void draw();
}
class Triangle extends Shape{

    Triangle(String name) {
        super(name);
    }

    @Override
    void draw() {
        System.out.println(name+"画三角形");
    }
}
public class Test {
    public static void main(String[] args) {
        Shape shape = new Triangle("帅哥");
        shape.draw();
    }
}
